package avicit.bdp.dgs.standard.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang3.StringUtils;

/**
 * @author mayi
 */
@ApiModel(value = "DataElementEvaluateTaskDTO", description = "数据项标准评估任务")
@Table(name = "bdp_dgs_data_element_evaluate_task")
public class DataElementEvaluateTaskDTO extends BaseDTO {

  private static final long serialVersionUID = 1L;

  /** 主键ID */
  @LogField
  @ApiModelProperty(value = "主键")
  @FieldRemark(column = "id", field = "id", name = "主键")
  @Column(name = "id")
  @avicit.platform6.core.annotation.log.Id
  @javax.persistence.Id
  private String id;

  /** 任务名称 */
  @LogField
  @ApiModelProperty(value = "任务名称", name = "name")
  @FieldRemark(column = "name", field = "name", name = "任务名称")
  private String name;

  /** 所属分类 */
  @LogField
  @ApiModelProperty(value = "所属分类", name = "typeId")
  @FieldRemark(column = "type_id", field = "typeId", name = "所属分类")
  private String typeId;

  @LogField
  @ApiModelProperty(value = "数据项标准ID列表(逗号分割)", name = "dataElementIds")
  @FieldRemark(column = "data_element_ids", field = "dataElementIds", name = "数据项标准ID列表(逗号分割)")
  private String dataElementIds;

  /** 任务描述 */
  @LogField
  @ApiModelProperty(value = "任务描述", name = "remark")
  @FieldRemark(column = "remark", field = "remark", name = "任务描述")
  private String remark;

  /** 是否启用，停用：0，启用：1 */
  @LogField
  @ApiModelProperty(value = "是否启用，停用：0，启用：1")
  @FieldRemark(column = "enable", field = "enable", name = "是否启用")
  private Integer enable;

  /** 启用定时任务，是：1，否：0 */
  @LogField
  @ApiModelProperty(value = "启用定时任务，是：1，否：0")
  @FieldRemark(column = "enable_cron_tab", field = "enableCronTab", name = "启用定时任务，是：1，否：0")
  private Integer enableCronTab;

  /** 调度流程定义id */
  @LogField
  @ApiModelProperty(value = "流程定义id")
  @FieldRemark(column = "process_definition_id", field = "processDefinitionId", name = "ds流程定义id")
  private String processDefinitionId;

  /** 定时任务数量 */
  @LogField
  @ApiModelProperty(value = "定时任务数量")
  @FieldRemark(column = "cron_task_num", field = "cronTaskNum", name = "定时任务数量")
  private Integer cronTaskNum;

  @Transient
  private Integer numberOfDataElements;

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getTypeId() {
    return typeId;
  }

  public void setTypeId(String typeId) {
    this.typeId = typeId;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public Integer getEnable() {
    return enable;
  }

  public void setEnable(Integer enable) {
    this.enable = enable;
  }

  public Integer getEnableCronTab() {
    return enableCronTab;
  }

  public void setEnableCronTab(Integer enableCronTab) {
    this.enableCronTab = enableCronTab;
  }

  public String getProcessDefinitionId() {
    return processDefinitionId;
  }

  public void setProcessDefinitionId(String processDefinitionId) {
    this.processDefinitionId = processDefinitionId;
  }

  public Integer getCronTaskNum() {
    return cronTaskNum;
  }

  public void setCronTaskNum(Integer cronTaskNum) {
    this.cronTaskNum = cronTaskNum;
  }

  public Integer getNumberOfDataElements() {
    return numberOfDataElements;
  }

  public void setNumberOfDataElements(Integer numberOfDataElements) {
    this.numberOfDataElements = numberOfDataElements;
  }

  public String getDataElementIds() {
    return dataElementIds;
  }

  public void setDataElementIds(String dataElementIds) {
    this.dataElementIds = dataElementIds;
  }

  @Override
  public String getLogFormName() {
    if (StringUtils.isEmpty(super.logFormName)) {
      return "数据项标准评估任务";
    } else {
      return super.logFormName;
    }
  }

  @Override
  public String getLogTitle() {
    if (StringUtils.isEmpty(super.logTitle)) {
      return "数据项标准评估任务";
    } else {
      return super.logTitle;
    }
  }
}
